package com.uzai.console.vo.turnlink;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @author mingyang.chen create in 2022/11/3 15:52
 */
@ApiModel("转链联盟配置VO")
@Data
@Accessors(chain = true)
public class TurnLinkLeagueSettingVo {

    @ApiModelProperty("ID主键")
    private Long id;

    /**
     * 平台
     */
    @ApiModelProperty("平台. 0: 淘宝, 1: 京东, 2: 拼多多, 3: 唯品会, 11: 抖音, 12:快手")
    private Integer platform;

    @ApiModelProperty("关联的联盟账号")
    private List<TurnLinkLeagueSettingVo.TurnLinkLeagueSettingAccount> relAccounts;

    @ApiModelProperty("扩展json")
    private JSONObject ext;

    @ApiModelProperty("链接URL")
    private String linkUrl;

    @ApiModel("转链联盟配置关联账号对象")
    @Data
    public static class TurnLinkLeagueSettingAccount {

        @ApiModelProperty("id")
        private Long id;

        @ApiModelProperty("推广位配置")
        public List<TurnLinkPromotion> promotion;

        @ApiModelProperty("联盟账号ID")
        private Long accountId;

        @ApiModelProperty("关联联盟账号类型. 0: 拼多多(多多进宝账号), 抖音(自营大人账号), 1: 拼多多(退老板账号), 抖音(官方共享账号), 2:抖音(穿山甲账号)")
        private Integer accountType;

        // 分割

        @ApiModelProperty("淘宝联盟账号")
        private String userName;

        @ApiModelProperty("淘宝联盟转链类型（0-返利；1-导购）")
        private Integer turnlink;

        @ApiModelProperty("授权时间-(淘宝, 唯品会)")
        private Integer authTime;

        @ApiModelProperty("授权过期时间-(淘宝)")
        private Integer exptime;

        @ApiModelProperty("京东联盟唯一ID")
        private String unionId;

        @ApiModelProperty("京东备注")
        private String remark;


        @ApiModelProperty("appId(抖音官方账号, 拼多多推老板)")
        private String appId;

        @ApiModelProperty("appKey(抖音官方账号, 拼多多推老板)")
        private String appKey;

        @ApiModelProperty("拼多多联盟账号")
        private String userId;

        @ApiModelProperty("授权key-(拼多多, 唯品会)")
        private String accessToken;

        @ApiModelProperty("到期时间-(拼多多, 唯品会)")
        private Integer expirestime;

        @ApiModelProperty("拼多多默认pid")
        private String defPid;

        @ApiModelProperty("唯品会用户ID")
        private String openId;

    }

    @Data
    @ApiModel("转链联盟推广位对象")
    public static class TurnLinkPromotion {

        @ApiModelProperty("pid")
        public String pid;

        @ApiModelProperty("备注")
        public String remark;

        @ApiModelProperty("是否时默认pid, 0: 不是, 1: 是, 淘宝平台使用")
        private Integer defPid;
    }
}
